public void outputReady(
final NHttpServerConnection conn,
final ContentEncoder encoder) throws HttpException, IOException {
final State state = getState(conn);
Asserts.notNull(state, "Connection state");
Asserts.check(state.getResponseState() == MessageState.BODY_STREAM,
"Unexpected response state %s", state.getResponseState());
final Outgoing outgoing = state.getOutgoing();
Asserts.notNull(outgoing, "Outgoing response");
final HttpAsyncResponseProducer responseProducer = outgoing.getProducer();
responseProducer.produceContent(encoder, conn);
if (encoder.isCompleted()) {
completeResponse(outgoing, conn, state);
}
}
|